<clr-modal [(clrModalOpen)]="createAppOpened" [clrModalSize]="'lg'">
  <h3 class="modal-title">{{appTitle}}</h3>
  <div class="modal-body">
    <form #appForm="ngForm" clrForm clrLayout="horizontal">
      <clr-select-container>
        <label class="required">命名空间</label>
        <select id="namespace_id" clrSelect [(ngModel)]="app.namespace.id" [disabled]="actionType==1" name="namespace_id">
          <option *ngFor="let namespace of namespaces" [ngValue]="namespace.id" [selected]="namespace.id == app.namespaceId">
            {{namespace.name}}
          </option>
        </select>
      </clr-select-container>
 
        <clr-input-container>
          <label class="required">{{'TITLE.NAME' | translate}}</label>
          <input clrInput type="text" id="app_name" [(ngModel)]="app.name" name="app_name" size="32" required
            [readonly]="actionType==1" pattern="[a-z]([-a-z0-9]*[a-z0-9])?" maxlength="32" (keyup)='handleValidation()'>
            <clr-control-error>
              项目名称不符合规范，验证规则[a-z]([-a-z0-9]*[a-z0-9])?
            </clr-control-error>
        </clr-input-container>
      
        <div class="clr-form-control clr-row">
          <label for="app_metadata" class="clr-control-label">元数据</label>
          <div class="clr-control-container clr-col-md-10 clr-col-12">
            <wayne-ace-editor-box></wayne-ace-editor-box>
          </div>
        </div>
        <clr-textarea-container>
          <label>元数据</label>
          <textarea id="app_description" clrTextarea [(ngModel)]="app.description" name="app_description" rows="3">
                    </textarea>
        </clr-textarea-container>
        
        <div class="modal-footer">

          <button type="button" class="btn btn-outline" (click)="onCancel()">{{'BUTTON.CANCEL' | translate}}</button>
          <button type="button" class="btn btn-primary" [disabled]="!isValid"
                  (click)="onSubmit()">{{'BUTTON.SUBMIT' | translate}}</button>
        </div>
    </form>
  </div>
</clr-modal>
